package com.tairan.chapter.web.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RestController
public class TestApi {

    @Value("${config.name}")
    private String name;

    @Value("${config.url}")
    private String url;

    @Value("${config.location}")
    private String location;

    @RequestMapping("/config-info")
    public String getConfigInfo() {
        return "从Gitlab仓库中获取得到我配置信息：【" + location + "," + url + "," + name + "】";
    }
}
